package org.fujene.memoryblock.structure;

import org.fujene.constants.Constants;
import org.fujene.structure.LookupPointer;

public class FixedLengthPointer extends SerializableNumber<LookupPointer>{
	private LookupPointer value;
	private int blocklen;

	// argument means block length
	public FixedLengthPointer(int len){
		super(Constants.BYTE_LOCALPTR + len);
		blocklen = len;
	}

	public FixedLengthPointer(byte[] b, int len){
		super(b, Constants.BYTE_LOCALPTR + len); // Do nothing
		blocklen = len;
		value = LookupPointer.fromBytes(b);
	}

	@Override
	public byte[] toByte(){
		return value.toBytes();
	}

	@Override
	public LookupPointer fromByte(byte[] b){
		value = LookupPointer.fromBytes(b);
		return value;
	}

	@Override
	public LookupPointer getValue(){
		return value;
	}

	@Override
	public void setValue(LookupPointer val){
		value = val;
	}

	@Override
	public double doubleValue(){
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public float floatValue(){
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int intValue(){
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public long longValue(){
		// TODO Auto-generated method stub
		return 0;
	}
}
